import { useHistory, useLocation } from 'react-router-dom'
import { NavBar } from 'antd-mobile'

import styles from './index.module.scss'
import { useEffect } from 'react'

const Result = () => {
  const history = useHistory()
  const location = useLocation()
  // console.log('location', location)
  const keyword = new URLSearchParams(location.search).get('keyword')
  console.log(keyword)

  useEffect(() => {
    // 根据keyword 发请求 获取数据 存入仓库 渲染页面
    // 上拉加载
  }, [])

  return (
    <div className={styles.root}>
      <NavBar onBack={() => history.go(-1)}>搜索结果</NavBar>
      <div className="article-list">
        <div className="article-item">文章列表</div>
      </div>
    </div>
  )
}

export default Result
